<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('修改部门信息')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
	<form class="form-horizontal m" id="form-post-edit" th:object="${personDept}">
		<input id="deptId" name="deptId" type="hidden" th:field="*{deptId}"/>
		<div class="form-group">
			<label class="col-sm-3 control-label">部门名称：</label>
			<div class="col-sm-8">
				<input class="form-control" type="text" name="deptName" id="deptName" th:field="*{deptName}" required>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">部门描述：</label>
			<div class="col-sm-8">
				<textarea id="deptDesc" name="deptDesc" class="form-control">[[*{deptDesc}]]</textarea>
			</div>
		</div>
	</form>
</div>
<th:block th:include="include :: footer" />
<script type="text/javascript">
	var prefix = ctx + "person/dept";

	$("#form-post-edit").validate({
		onkeyup: false,
		rules:{
			// postName:{
			// 	remote: {
			//         url: prefix+ "/checkTypeNameUnique",
			//         type: "post",
			//         dataType: "json",
			//         data: {
			//         	"typeId": function() {
			// 			    return $("input[name='typeId']").val();
			// 			},
			//         	"typeName" : function() {
			//                 return $.common.trim($("#typeName").val());
			//             }
			//         },
			//         dataFilter: function(data, type) {
			//         	return $.validate.unique(data);
			//         }
			//     }
			// },

			deptId:{
				digits:true
			}
		},
		// messages: {
		//
		//     "typeName": {
		//         remote: "公告名称已经存在"
		//     }
		// },
		focusCleanup: true
	});

	function submitHandler() {
		if ($.validate.form()) {
			$.operate.save(prefix + "/edit", $('#form-post-edit').serialize());
		}
	}
</script>
</body>
</html>
